#include("./layout.html")
#@layout()

#define css()
<style>
    
    
</style>
#end

#define script()
    <script type="text/javascript">
        var headerSwiper = new Swiper('#header-swiper', {
            direction: 'horizontal',
            speed: 1000,
            // preventClicks: false, // 是否滑动时触发链接
            // preventClicksPropagation: true, // 阻止click冒泡。拖动Swiper时阻止click事件
            // stopOnLastSlide: false,
            // disableOnInteraction: true,
            // grabCursor: true,
            autoplay: {
                delay: 6000
            },
            loop: true, // 循环模式选项
            // 如果需要分页器
            // pagination: {
            //     el: '.swiper-pagination1',
            // },

        })

        // 调用公告滚动函数
        $(function () {
            setInterval("noticeUp('.notice ul','-55px',1000)", 2000);
        });


        var newSwiper = new Swiper('#new-swiper', {
            direction: 'horizontal',
            speed: 300,
            loop: true,
            autoplay: {
                delay: 2000
            },
            pagination: {
                el: ".swiper-pagination2",
                clickable: true,
                // clickableClass: 'swiper-pagination-clickable',
                renderBullet: function (index, className) {
                    return '<span class="' + className + '">' + (index + 1) + "</span>";
                },
            },
            navigation: {
                nextEl: '.swiper-button-next2',
                prevEl: '.swiper-button-prev2',
            },

            effect: 'fade',
            on: {
                click: function (swiper, event) {
                    
                    
                     window.open(event.target.id, "_self");
                },
            },

        })

        //鼠标移入停止播放，鼠标离开  继续轮播
        newSwiper.el.onmouseover = function () {
            newSwiper.autoplay.stop();
        }
        newSwiper.el.onmouseleave = function () {
            newSwiper.autoplay.start();
        }

        //鼠标移出隐藏按钮，移入显示按钮
        // newSwiper.el.onmouseover = function () {
        //     newSwiper.navigation.$nextEl.removeClass('swiper-button-hide');
        //     newSwiper.navigation.$prevEl.removeClass('swiper-button-hide');
        // }
        // newSwiper.el.onmouseout = function () {
        //     newSwiper.navigation.$nextEl.addClass('swiper-button-hide');
        //     newSwiper.navigation.$prevEl.addClass('swiper-button-hide');
        // }

        var schoolSwiper = new Swiper('#school-swiper', {
            direction: 'horizontal',
            speed: 300,
            loop: true,
            autoplay: {
                delay: 2000
            },
            slidesPerView: 4,
            spaceBetween: 30,
            freeMode: true,
            pagination: {
                el: ".school-swiper-pagination",
                clickable: true,
                dynamicBullets: true,
            },

            on: {
                click: function (swiper, event) {
                    console.log('event ->', event.target.id)
                    window.open(event.target.id, "_self");
                },
            },
            
        })

        function substrLength2(element, length) {  //elementId：元素id，length：需保留字符串长度
            // var text = document.getElementById(elementId);
            var result = "";
            if (element.innerText.length > length) {
                result = element.innerText.substr(0, length) + "...";
            } else {
                result = element.innerText;
            }
            element.innerText = result;

            
        }

        function formatArticleContent() {
            var elements = document.getElementsByName("news-channel-article-title")
            for (i = 0; i < elements.length; i++) {
                substrLength2(elements[i], 25)
            }
        }

        formatArticleContent()
        

    </script>
#end

#define content()
<div>

    <!-- 轮播图 -->

    <div class="container ">
        <div class="swiper swiper1" id="header-swiper">

            <div class="swiper-wrapper">
                <div class="swiper-slide"><img src="img/banner1.jpg" alt="" /></div>
                <div class="swiper-slide"><img src="img/banner2.jpg" alt="" /></div>
            </div>
            <!-- 如果需要分页器 -->
            <div class="swiper-pagination swiper-pagination1"></div>

            <!-- 如果需要导航按钮 -->
            <!-- <div class="swiper-button-prev swiper-button-prev1"></div> -->
            <!-- <div class="swiper-button-next swiper-button-next1"></div> -->

        </div>
    </div>

    
     #categories(flag = "today-tou-tiao",asTree = false)
     
     #set(touTiaoCategory = categories[0])
     
     #end

    <!-- 通知公告 -->
    <div class="container ">
        <div class="notice_tip">
            <div class="banner">通 知 公 告</div>
            <div class="notice">
                <ul>
                    #categoryArticles(categoryId = touTiaoCategory.id,orderBy="id desc",count = 6)

                            #for(article : articles)
                                <li><a href="#(article.url ??)" target="_self">#(article.title ??)</a></li>
                            #end
                    #end
                    
                </ul>
            </div>
        </div>
    </div>




    <!-- 新闻板块1 -->
    <div class="container" style="margin-top: 20px;">

        <div class="row">
            <!-- 新闻轮播图 -->
            <div class="col-xs-12 col-sm-12 col-md-8 ">
                <div class="swiper border_radius box_shadow" id="new-swiper"
                    style="position: relative; height: 400px; width: 100%;">
                    <div class="swiper-wrapper ">
                        #categoryArticles(categoryFlag = "today-tou-tiao", hasThumbnail=true, count = 5)

                            #for(article : articles)
                                
                                <div class="swiper-slide">
                                    <img src="#(article.thumbnail ??)" alt="" id="#(article.url)" />
                                    <div
                                        style="position: absolute;height: 40px; line-height: 40px; width: 100%; background-color: #000; opacity: 0.4;bottom: 0px;">
                                        #(article.title ??)
                                    </div>
                                </div>
                        
                            #end
                         #end
                        
                        
                        
                    </div>

                    <div class="swiper-pagination swiper-pagination2"></div>
                    <div class="swiper-button-prev swiper-button-prev2"></div>
                    <div class="swiper-button-next swiper-button-next2"></div>

                </div>
            </div>
            <!-- 新闻选项卡-->
            <div class="col-xs-12 col-sm-12 col-md-4">

                <div class="news_selection_block_2  border_radius box_shadow "
                    style="background-color: #BA1C1C; height: 400px;">
                    <div style="padding: 12px;">
                        <img src="img/zhongguomeng.jpg"> </img>
                    </div>
                    <ul>
                        #categoryArticles(categoryFlag = "news-channel", hasThumbnail=false, orderBy="id desc", count = 6)

                            #for(article : articles)
                                
                                <li>
                                    <a href="#(article.url)" target="_self">
                                        <div style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><span>&#155</span>#(article.title)</div>
                                    </a>
                                </li>
                        
                            #end
                         #end
                         
                    </ul>
                </div>

            </div>
        </div>
    </div>

    <!-- 教育培训 -->
    <div class="container " style="margin-top: 20px;">
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-4 " style="padding-right: 5px;">
                <div class="border_radius box_shadow" style="height: 350px; background-color: #fff;">
                    <!-- 栏目 -->
                   
                    
                    <div class="news_subject_style">

                        <div class="d_flex_direction_row">
                            <div class="news_subject_icon"></div>
                            <div class="news_subject_title"> <span>教育培训</span> </div>
                        </div>

                        <div><a href="#"><img src="img/more.jpg" alt=""></img></a></div>
                    </div>
                    <hr class="hr-twill" />
                    <div class="news_list_block">
                        <ul>
                             #categoryArticles(categoryFlag = "education", hasThumbnail=false, orderBy="id desc", count = 20)

                                #set(map = {})
                                #for(article : articles)
                                   #set(id=article.id)
                                   #set(map[""+id] = article)
                                   
                                #end
                                
                                #for(na : map)
                                    #if(for.index < 6)
                                        
                                        <li>
                                        <a href="#(na.value.url)" target="_self">
                                            <div class="news_list_block_row">
                                                <div class="new_li_dot">&#155</div>
                                                <div class="new_title_font_style">#(na.value.title)</div>
                                            </div>
        
                                        </a>
                                    </li>
                                    #end
                                #end
                            
                            #end
                            
                        </ul>

                    </div>

                </div>
            </div>
            <div class="col-xs-12 col-sm-12 col-md-4 " style="padding-right: 5px;">
                <div class="border_radius box_shadow" style="height: 350px; background-color: #fff;">
                    <!-- 栏目 -->
                    <div class="news_subject_style">

                        <div class="d_flex_direction_row">
                            <div class="news_subject_icon"></div>
                            <div class="news_subject_title"> <span>科研咨询</span> </div>
                        </div>

                        <div><a href="#"><img src="img/more.jpg" alt=""></img></a></div>
                    </div>
                    <hr class="hr-twill" />
                    <div class="news_list_block">
                        <ul>
                            #categoryArticles(categoryFlag = "scientific-research", hasThumbnail=false, orderBy="id desc", count = 20)

                                #set(map = {})
                                #for(article : articles)
                                   #set(id=article.id)
                                   #set(map[""+id] = article)
                                   
                                #end
                                
                                #for(na : map)
                                    #if(for.index < 6)
                                        
                                        <li>
                                        <a href="#(na.value.url)" target="_self">
                                            <div class="news_list_block_row">
                                                <div class="new_li_dot">&#155</div>
                                                <div class="new_title_font_style">#(na.value.title)</div>
                                            </div>
        
                                        </a>
                                    </li>
                                    #end
                                #end
                            
                            #end
                            
                        </ul>

                    </div>

                </div>
            </div>
            <div class="col-xs-12 col-sm-12 col-md-4 " style="padding-right: 5px;">
                <div class="border_radius box_shadow" style="height: 350px; background-color: #fff;">
                    <!-- 栏目 -->
                    <div class="news_subject_style">

                        <div class="d_flex_direction_row">
                            <div class="news_subject_icon"></div>
                            <div class="news_subject_title"> <span>管理服务</span> </div>
                        </div>

                        <div><a href="#"><img src="img/more.jpg" alt=""></img></a></div>
                    </div>
                    <hr class="hr-twill" />
                    <div class="news_list_block">
                        <ul>
                            #categoryArticles(categoryFlag = "management-service", hasThumbnail=false, orderBy="id desc", count = 20)

                                #set(map = {})
                                #for(article : articles)
                                   #set(id=article.id)
                                   #set(map[""+id] = article)
                                   
                                #end
                                
                                #for(na : map)
                                    #if(for.index < 6)
                                        
                                        <li>
                                        <a href="#(na.value.url)" target="_self">
                                            <div class="news_list_block_row">
                                                <div class="new_li_dot">&#155</div>
                                                <div class="new_title_font_style">#(na.value.title)</div>
                                            </div>
        
                                        </a>
                                    </li>
                                    #end
                                #end
                            
                            #end
                            
                        </ul>

                    </div>

                </div>
            </div>
        </div>
    </div>


    <div class="container " style="margin-top: 20px;">
        <div class="row">
            <!-- 机关党建 -->
            <div class="col-xs-12 col-sm-12 col-md-4 " style="padding-right: 5px;">
                <div class="border_radius box_shadow" style="height: 350px; background-color: #fff;">
                    <!-- 栏目 -->
                    <div class="news_subject_style">

                        <div class="d_flex_direction_row">
                            <div class="news_subject_icon"></div>
                            <div class="news_subject_title"> <span>机关党建</span> </div>
                        </div>

                        <div><a href="#"><img src="img/more.jpg" alt=""></img></a></div>
                    </div>
                    <hr class="hr-twill" />
                    <div class="news_list_block">
                        <ul>
                            #categoryArticles(categoryFlag = "organ-party-building", hasThumbnail=false, orderBy="id desc", count = 20)

                                #set(map = {})
                                #for(article : articles)
                                   #set(id=article.id)
                                   #set(map[""+id] = article)
                                   
                                #end
                                
                                #for(na : map)
                                    #if(for.index < 6)
                                        
                                        <li>
                                        <a href="#(na.value.url)" target="_self">
                                            <div class="news_list_block_row">
                                                <div class="new_li_dot">&#155</div>
                                                <div class="new_title_font_style">#(na.value.title)</div>
                                            </div>
        
                                        </a>
                                    </li>
                                    #end
                                #end
                            
                            #end
                        </ul>

                    </div>

                </div>
            </div>
            <!-- 专题活动 -->
            <div class="col-xs-12 col-sm-12 col-md-4 " style="padding-right: 5px;">
                <div class="border_radius box_shadow" style="height: 350px; background-color: #fff;">
                    <!-- 栏目 -->
                    <div class="news_subject_style">

                        <div class="d_flex_direction_row">
                            <div class="news_subject_icon"></div>
                            <div class="news_subject_title"> <span>专题活动</span> </div>
                        </div>

                        <div><a href="#"><img src="img/more.jpg" alt=""></img></a></div>
                    </div>
                    <hr class="hr-twill" />
                    <div class="news_list_block">
                        <ul>
                            #categoryArticles(categoryFlag = "thematic-activity", hasThumbnail=false, count=20)
                                #set(map = {})
                                #for(article : articles)
                                   #set(id=article.id)
                                   #set(map[""+id] = article)
                                   
                                #end
                                
                                #for(na : map)
                                    #if(for.index < 6)
                                        
                                        <li>
                                        <a href="#(na.value.url)" target="_self">
                                            <div class="news_list_block_row">
                                                <div class="new_li_dot">&#155</div>
                                                <div class="new_title_font_style">#(na.value.title)</div>
                                            </div>
        
                                        </a>
                                    </li>
                                    #end
                                    
                                #end
                            
                            #end
                        </ul>

                    </div>

                </div>
            </div>
            <!-- 学习园地 -->
            <div class="col-xs-12 col-sm-12 col-md-4 " style="padding-right: 5px;">
                <div class="border_radius box_shadow" style="height: 350px; background-color: #fff;">
                    <!-- 栏目 -->
                    <div class="news_subject_style">

                        <div class="d_flex_direction_row">
                            <div class="news_subject_icon"></div>
                            <div class="news_subject_title"> <span>学习园地</span> </div>
                        </div>

                        <div><a href="#"><img src="img/more.jpg" alt=""></img></a></div>
                    </div>
                    <hr class="hr-twill" />
                    <div class="news_list_block">
                        <ul>
                            #categoryArticles(categoryFlag = "learning-garden", hasThumbnail=false, orderBy="id desc", count = 20)

                                #set(map = {})
                                #for(article : articles)
                                   #set(id=article.id)
                                   #set(map[""+id] = article)
                                   
                                #end
                                
                                #for(na : map)
                                    #if(for.index < 6)
                                        
                                        <li>
                                        <a href="#(na.value.url)" target="_self">
                                            <div class="news_list_block_row">
                                                <div class="new_li_dot">&#155</div>
                                                <div class="new_title_font_style">#(na.value.title)</div>
                                            </div>
        
                                        </a>
                                    </li>
                                    #end
                                    
                                #end
                            
                            #end
                        </ul>

                    </div>

                </div>
            </div>
        </div>
    </div>

  

    <!-- 校园掠影 -->
    <div class="container" style="margin-top: 20px;">
        <div class="school-container">
            <div class="school-nav">校园掠影</div>
            <img src="img/school/1_03.png">
        </div>

    </div>
    <div class="container " style="margin-top: 20px;">
        <div class="swiper school-swiper " id="school-swiper">
            <div class="swiper-wrapper">
                #categoryArticles(categoryFlag = "school-glimpse", hasThumbnail=true, orderBy="id desc", count = 6)
                    #for(article : articles)
                    
                        <div class="swiper-slide shcool-swiper-slide "><img style="cursor:pointer" src="#(article.thumbnail)" alt="" id="#(article.url)" /></div>
                        <div class="swiper-slide shcool-swiper-slide "><img style="cursor:pointer" src="#(article.thumbnail)" alt="" id="#(article.url)" /></div>
                    #end
                #end
            </div>
            <!-- 如果需要分页器 -->
            <div class="swiper-pagination school-swiper-pagination "></div>

            <!-- 如果需要导航按钮 -->
            <!-- <div class="swiper-button-prev swiper-button-prev1"></div> -->
            <!-- <div class="swiper-button-next swiper-button-next1"></div> -->

        </div>

    </div>

    <!-- 友情链接 -->
    <div class="container-flud friend-link-flud">
        <div class="container ">
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-2 friend-link-left-font">
                    友情链接
                </div>
                <div class="col-xs-12 col-sm-12 col-md-10 bootstrap_col" style="border-left: 1px solid #cbcbcc;">
                    <div id="friend-link">
                        <ul>
                            <li>
                                <a href="#"> 中共中央党校（国家行政学院）</a>

                            </li>
                            <li>
                                <a href="#"> 中央社会主义学院</a>
                            </li>
                            <li>
                                <a href="#"> 中共河南省委党校（河南行政学院）</a>
                            </li>
                            <li>
                                <a href="#"> 濮阳网</a>
                            </li>
                            <li>
                                <a href="#"> 中国共产党思想理论资源数据库</a>
                            </li>
                            <li>
                                <a href="#"> 抗日战争与近代中日关系文献数据平台</a>
                            </li>
                            <li>
                                <a href="#"> 中国改革开放数据库</a>
                            </li>
                        </ul>
                    </div>


                </div>
            </div>
        </div>

    </div>




</div>
#end

